//
//  GYMineShopAddressCell.m
//  GYDemo
//
//  Created by mac on 2018/6/20.
//  Copyright © 2018年 mac. All rights reserved.
//

#import "GYMineShopAddressCell.h"
#import "Head.h"

@interface GYMineShopAddressCell()
@property (nonatomic,strong) UILabel *titleLB;
@property (nonatomic,strong) UILabel *detailLB;
@property (nonatomic,strong) UIView *sep;
@property (nonatomic,strong) UIView *sep2;
@end

@implementation GYMineShopAddressCell
#pragma mark - getter and setter
-(UILabel *)titleLB
{
    if (!_titleLB) {
        _titleLB = [UILabel new];
        _titleLB.frame = WFCGRectMake(13, 15, 375 - 26, 16);
        _titleLB.textColor = Main_Color_Black;
        _titleLB.font = SYSTEMBOLDFONT(15);
    }
    return _titleLB;
}
- (UILabel *)detailLB {
    if (!_detailLB) {
        _detailLB = [UILabel new];
        _detailLB.frame = WFCGRectMake(13, 44, 375 - 26, 50);
        _detailLB.textColor = Main_Color_Gray;
        _detailLB.font = SYSTEMFONT(13);
        _detailLB.numberOfLines = 0;
    }
    return _detailLB;
}
- (UIView *)sep {
    if (!_sep) {
        _sep = [UILabel new];
        _sep.frame = WFCGRectMake(0, 95, 375, 1);
        _sep.backgroundColor = Main_Color_BG;
    }
    return _sep;
}
- (UIView *)sep2 {
    if (!_sep2) {
        _sep2 = [UILabel new];
        _sep2.frame = WFCGRectMake(375 / 2 - 0.5, 110, 1, 22);
        _sep2.backgroundColor = Main_Color_BG;
    }
    return _sep2;
}
- (UIButton *)editBTN {
    if (!_editBTN) {
        _editBTN = [UIButton new];
        _editBTN.frame = WFCGRectMake(0, 96, 375 / 2, 148 - 96);
        _editBTN.titleLabel.font = SYSTEMFONT(14);
        [_editBTN setTitle:@"编辑" forState:UIControlStateNormal];
        [_editBTN setTitleColor:Main_Color_Gray forState:UIControlStateNormal];
    }
    return _editBTN;
}
- (UIButton *)deleteBTN {
    if  (!_deleteBTN) {
        _deleteBTN = [UIButton new];
        _deleteBTN.frame = WFCGRectMake(375 / 2, 96, 375 / 2, 148 - 96);
        _deleteBTN.titleLabel.font = SYSTEMFONT(14);
        [_deleteBTN setTitle:@"删除" forState:UIControlStateNormal];
        [_deleteBTN setTitleColor:Main_Color_Red forState:UIControlStateNormal];
    }
    return _deleteBTN;
}
-(void)setModel:(GYMineShopAddressModel *)model
{
    _model = model;
    NSString *name = _model.name;
    NSString *mobile = _model.phone;
    NSString *titles = [NSString stringWithFormat:@"收货人：%@  %@",name,mobile];
    _titleLB.text = titles;
    NSString *province = _model.province;

    NSString *addr = _model.address;
    NSString *details = [NSString stringWithFormat:@"%@%@",province,addr];
    _detailLB.text = details;
}
#pragma mark - event
#pragma mark - method
-(CGFloat)finalHeight
{
    return WFCGFloatY(96);
}
#pragma mark - life
-(void)setFrame:(CGRect)frame
{
    frame.size.height -= WFCGFloatY(5);
    [super setFrame:frame];
}
-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        self.contentView.backgroundColor = Main_Color_White;
        [self.contentView addSubview:self.titleLB];
        [self.contentView addSubview:self.detailLB];
        [self.contentView addSubview:self.sep];
        [self.contentView addSubview:self.sep2];
//        [self.contentView addSubview:self.editBTN];
//        [self.contentView addSubview:self.deleteBTN];
    }
    return self;
}

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}
@end
